
/*
vgTerminal.cc
This file is part of opengl-vrml-assembly.
Copyright (C) Rafal Pielech, rafal.pielech@gmail.com

opengl-vrml-assembly is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

opengl-vrml-assembly is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with opengl-vrml-assembly.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <windows.h>
#include <vgDebug.h>
#include <vgTerminal.h>

vgTerminal::vgTerminal(void)
{}

void vgTerminal::vgRun(void)
{
	// Terminal window handle initially set to NULL
	screenSurfaceHandle = NULL;

	// Creating the Window
	screenSurfaceHandle = ::CreateWindowEx(WS_EX_CLIENTEDGE,
							vgWindow::VG_WND_CLASS_TERMINAL,
							"vgTerminal",
							WS_OVERLAPPEDWINDOW,
							CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
							NULL, NULL, GetModuleHandle(NULL), NULL);

	::ShowWindow(screenSurfaceHandle, SW_SHOW);
	::UpdateWindow(screenSurfaceHandle);

	// The Message Loop
	::MSG msg;
	while(::GetMessage(&msg, NULL, 0, 0) > 0)
	{
		::TranslateMessage(&msg);
		::DispatchMessage(&msg);
	}
}

const HWND vgTerminal::vgGetTermianlWindowHandle(void) const
{
  return screenSurfaceHandle;
}

vgTerminal::~vgTerminal(void)
{}
